﻿namespace h4
{
    public class Circle
    {
        private double _radius;

        public Circle()
        {
        }

        public Circle(double radius)
        {
            _radius = radius;
        }

        public double Radius
        {
            get { return _radius; }
            set { _radius = value; }
        }

        public double CalculateCircumference()
        {
            return 2 * Math.PI * _radius;
        }

        public double CalculateArea()
        {
            return Math.PI * _radius * _radius;
        }

        public void DisplayInfo()
        {
            Console.WriteLine($"圆的半径: {_radius}");
            Console.WriteLine($"圆的周长: {CalculateCircumference():F2}");
            Console.WriteLine($"圆的面积: {CalculateArea():F2}");
            Console.WriteLine("------------------------");
        }
    }

    internal class Program
    {
        public static void Main(string[] args)
        {
            Circle circle1 = new Circle();
            circle1.Radius = 5;
            Console.WriteLine("第一个圆的信息:");
            circle1.DisplayInfo();

            Circle circle2 = new Circle(3.5);
            Console.WriteLine("第二个圆的信息:");
            circle2.DisplayInfo();

            circle2.Radius = 7;
            Console.WriteLine("修改半径后的第二个圆信息:");
            circle2.DisplayInfo();
        }
    }
}
